home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Games: Greatest Hits 1996
/
Amiga Games: Greatest Hits 1996.iso
/
archive
/
userbox
/
publicdomain
/
edspell.lha
/
EdSpell
/
Rexx
/
DeleteWord.epxx
< prev
next >
Wrap
Text File
|
1996-07-28
|
3KB
|
75 lines
/************************************************************************/
/* */
/* File : DeleteWord.epxx */
/* Author : Martin Reddy */
/* Date : 28/8/92 */
/* Purpose : An ARexx script used to control the text editor EdWord */
/* Note : This is part of the Spell Checking facility of EdWord */
/* Function : This script prompts the user for a string and then it */
/* will remove all occurrences of that word from the default */
/* ISpell user dictionary (i.e. EdSpell:Dict/UserDict.txt). */
/* */
/* If a word is removed from the dictionary, then the curr- */
/* ently loaded ISpell dictionary will be removed from RAM */
/* so that it must be fetched from disk next time it is */
/* requested. */
/* */
/************************************************************************/
/* Set CONFIRM_DELETION to TRUE if you want the script to get
confirmation from the user before attempting to delete a word
from the user dictionary. If you set this to FALSE then you
will receive no such choice and the word will be immediately
deleted after you type it in. */
CONFIRM_DELETION = TRUE
/*-------------- Nothing To Change Below Here -----------*/
HOST = ADDRESS()
ADDRESS VALUE HOST
OPTIONS RESULTS
/**************** Get a Word From The User *****************/
GetInput "Enter Word To Delete From Dictionary :"
IF RESULT ~= "RESULT" THEN DO
WORD = COMPRESS( UPPER(RESULT), '~`,./<>?;:"[]{}!@#$%^&*()+|=\- ' )
/************* confirm deletion of the word *************/
IF CONFIRM_DELETION == TRUE THEN DO
CHOICE "Please confirm deletion of "||WORD||"| from your User Dictonary.@@Yes, Delete|No, Cancel"
IF RC == 0 THEN EXIT
END
/************* Now try to delete the word *************/
ADDRESS COMMAND 'EdSpell:Utils/DelWord '||WORD
IF RC == 0 THEN DO
Inform WORD||" has been removed|from your User Dictonary."
CALL UnloadDict
END; ELSE IF RC == 1 THEN DO
Inform "The word "||WORD||"|is not in your User Dictonary."
END; ELSE DO
Inform "A disk error occurred!|Word not removed."
END;
END
EXIT
/************ PROCEDURE: "UnLoadDict" ************/
UnloadDict: PROCEDURE
IF ~SHOW( PORTS, 'IRexxSpell' ) THEN RETURN
ADDRESS "IRexxSpell" EXIT
RETURN